#coding=utf-8
'''
Created on 2011-1-8

@author: zarra
'''
import cherrypy
import sys,os,time
#from conf import PROJECT_PATH

PROJECT_PATH     = os.path.abspath(os.path.dirname(__file__))
PROJECT_Parent_PATH=os.path.split(PROJECT_PATH)[0]
sys.path.extend( [os.path.join(PROJECT_Parent_PATH,'expr'),os.path.join(PROJECT_Parent_PATH,'zapple')])

import conf
from root import Root



#cherrypy.config.update({'environment': 'embedded'})

#获得修改日期
stat = os.stat(__file__)
mtime =  time.localtime(stat.st_mtime)

conf.cmtime = "%d%02d%02d_%02d%02d%02d"%(mtime.tm_year,\
                           mtime.tm_mon,\
                           mtime.tm_mday,\
                           mtime.tm_hour,\
                           mtime.tm_min,\
                           mtime.tm_sec)
#获得svn版本号
try:
    version_file = os.path.join(PROJECT_PATH,'version')
    sys.stderr.write(version_file)
    conf.version = file(version_file).read()[:-1]
    sys.stderr.write(conf.version+'\n')
except:
    sys.stderr.write('lalalala\n')
    
    
cherrypy.config.update(conf.global_conf)
    
root=Root()
application = cherrypy.Application(root,conf.SITE_ROOT,config=None)
